package org.example.config;

/**
 * 枚举了一些常用API操作码
 * Created by jones on 2023/6/1.
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    STORE_OUT_RANGE(1401, "超出范围限制操作"),
    STORE_NO_DOOR(1404, "无设备信息"),
    COUPON_NO_USER(1405, "没有可用的抵用券了哦"),
    OPEN_DOOR_FAILED(1400, "开门出错了,请稍后重试"),
    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    ORDER_ERROR(1500, "下单失败"),
    EXPIRATION_ERROR(1000, "活动已过期"),
    FORBIDDEN(403, "没有相关权限");

    private long code;
    private String message;

    private ResultCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    public long getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
